<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>Розклад групи {{ group_name }}</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <style type="text/css">
        #schedule-table {
            border-radius: 15px;
            background-color: #064e00;
            border-collapse: collapse;
        }

        th {
            background-color: #064e00;
            border-color: #064e00;
        }

        td {
            background-color: #d0e9ff;
            border: 1px solid #064e00;
        }

        .top-header {
            border-top: solid 1px #064e00;
        }

        .left-header {
            border-left: solid 1px #064e00;
        }

        .top-corner {
            border-top: solid 1px #064e00;
            border-left: solid 1px #064e00;
            border-radius: 15px 0 0 0;
        }

        .inactive {
            color: #7c7d7c;
        }

        .today {
            background-color: #fff7c2;
        }

        .corner {
            border-radius: 15px;
            padding: 7px;
        }

        .corner-left-down {
            border-radius: 0 0 15px 0;
            padding: 7px;
        }

        .odd {
            border-bottom-color: #b3b4b3;
        }

        .even {
            border-top-color: #b3b4b3;
        }

        .first-group-part {
            border-right-style: dashed;
            border-right-color: #b3b4b3;
        }

        .second-group-part {
            border-left-style: dashed;
            border-left-color: #b3b4b3;
        }
    </style>
</head>
<body>
<div align="center">Розклад групи {{ group_name }}</div>
<table id="schedule-table">
    <tbody>
    <tr>
        <th class="corner"></th>
        <th colspan="2">ПН</th>
        <th colspan="2">ВТ</th>
        <th colspan="2">СР</th>
        <th colspan="2">ЧТ</th>
        <th colspan="2" class="corner">ПТ</th>
    </tr>
    {% for lessons in schedule %}
        <tr>
            {% if not forloop.counter|divisibleby:2 %}
                <th rowspan="2" {% ifequal forloop.counter 9 %}
                    class="corner" {% endifequal %}>{% widthratio forloop.counter 2 1 %}</th>
            {% endif %}
            {% for lesson in lessons %}
                <td class="
                    {% if lesson.day == today %}
                        today
                    {% endif %}
                    {% if lesson.even == 1 %}
                        odd
                        {% if not odd %}
                            inactive
                        {% endif %}
                    {% endif %}
                    {% if lesson.even == 2 %}
                        even
                        {% if odd %}
                            inactive
                        {% endif %}
                    {% endif %}
                    {% ifequal lesson.common 1 %}
                        first-group-part
                    {% endifequal %}
                    {% ifequal lesson.common  2 %}
                        second-group-part
                    {% endifequal %}"
                    colspan="
                        {% if lesson.common == 0 %}2{% endif %}
                        {% if lesson.common == 1 %}1{% endif %}
                        {% if lesson.common == 2 %}1{% endif %}"
                    rowspan="
                        {% if lesson.even == 0 %}2{% endif %}
                        {% if lesson.even == 1 %}1{% endif %}
                        {% if lesson.even == 2 %}1{% endif %}">
                    {{ lesson.subject.name }}
                </td>
            {% endfor %}
        </tr>
    {% endfor %}
    </tbody>
</table>
</body>
</html>